﻿<%@ Page Title="Keywords" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" 
CodeFile="Keywords.aspx.cs" Inherits="Stats_Keywords" ValidateRequest="false" %>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" Runat="Server">
    <asp:Panel ID="AddNew" runat="server">
        <asp:Label ID="AddLabel" runat="server" Text="New Keyword" EnableViewState="false"/>
        <br />
        <asp:TextBox ID="KeywordName" runat="server" EnableViewState="false"/>
        <asp:Button ID="AddKeyword" runat="server" Text="Add" 
            onclick="AddKeyword_Click" />
        <br />
        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" 
            ControlToValidate="KeywordName" runat="server" ErrorMessage="Enter keyword" 
            ForeColor="Red" />
    </asp:Panel>
    <br />
    <asp:GridView ID="AllKeywords" runat="server" AllowPaging="True" 
        AllowSorting="True" AutoGenerateColumns="False" DataKeyNames="Id" 
        DataSourceID="KeywordsEDS" CellPadding="4" ForeColor="#333333" 
        GridLines="None" onselectedindexchanged="AllKeywords_SelectedIndexChanged" 
        onrowdeleting="AllKeywords_RowDeleting">
        <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
        <Columns>
            <asp:CommandField ShowDeleteButton="True" />
            <asp:BoundField DataField="Keyword" HeaderText="Keyword" 
                SortExpression="Keyword" />
            <asp:CommandField SelectText="Statistics" ShowSelectButton="True"/>
        </Columns>
        <EditRowStyle BackColor="#999999" />
        <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
        <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
        <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
        <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
        <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
        <SortedAscendingCellStyle BackColor="#E9E7E2" />
        <SortedAscendingHeaderStyle BackColor="#506C8C" />
        <SortedDescendingCellStyle BackColor="#FFFDF8" />
        <SortedDescendingHeaderStyle BackColor="#6F8DAE" />
        <EmptyDataRowStyle ForeColor="Black" Font-Size="18px" />
        <EmptyDataTemplate>
            <asp:Image ID="NotFoundKeywords" ImageUrl="../Images/NotFound.png" CssClass="NotFoundImage" runat="server"/>
            <br />
            There's no keywords in database
        </EmptyDataTemplate>
    </asp:GridView>
    
    <asp:EntityDataSource ID="KeywordsEDS" runat="server" 
        ConnectionString="name=TwitterEntities" DefaultContainerName="TwitterEntities" 
        EnableDelete="True" EnableFlattening="False" EntitySetName="Keywords">
    </asp:EntityDataSource>
    
</asp:Content>

